#ifndef __PORT_PWM_H__
#define __PORT_PWM_H__


typedef struct
{
	u8 disp_start;
	u8 tick_start;
	u8 tick_cnt;
	u16 fade_steps;	//渐变过程变量
	u16 color_switch_time;	//过多长时间切换颜色Calm,Aurora,Energy,pulse需要
	u8 cur_color_table[6];
	u8 next_color_table[6];
	u32 ticks_grow;
}disp_status_t;

//extern u8 rgb_buf[74];
void rgb_light_exit(void);
void rgb_light_set(u8* color_table);
u8 display_glow_mode(disp_status_t* p_disp_status);
void com_memset(void *s,int c,size_t n);
void com_memcpy(void *dst,const void *src,size_t length);
void rgb_power_onoff(u8 onoff);

void pwm_init(void);
void pwm_rgb_write(u8 red, u8 green, u8 blue);
void pwm_rgb_close(void);

void energy_led_init(void);
void energy_led_level_calc(void);
void energy_led_scan(void);
#endif //__PORT_PWM_H__
